// ==UserScript==
// @name           SFEE Find My Trackers
// @namespace      oasis.mitra.com
// @description    Searches a project for trackers owned by ME
// @include        http://oasis.mitra.com*/sf/tracker/do/searchTracker/projects.*/tracker
// ==/UserScript==
var assignedToElements = document.getElementsByName('assignedTo');
var assignedToValue;
var assignedTo;
var me;

var meElement = document.getElementById('UserLoggedIn');
var end = meElement.innerHTML.lastIndexOf('&nbsp;');
me = meElement.innerHTML.substring(16, end);

var options = document.getElementsByName('assignedTo');

for( var j = 0; j < options[0].length; j++ )
{
	if( options[0][j].innerHTML == me )
	{
	        options[0][j].selected = true;
		break;
	}
}

var searchResults = document.getElementById('ArtifactListTable');
if( searchResults == null )
{
	var search = document.getElementById('doSearch');
	window.location.href = search.href;
}
